package com.project.common.service.impl;

import com.project.common.entity.SysMenuRole;
import com.project.common.mapper.SysMenuRoleMapper;
import com.project.common.service.SysMenuRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class SysMenuRoleImpl implements SysMenuRoleService {
    @Autowired
    private SysMenuRoleMapper sysMenuRoleMapper;

    @Override
    public int insertSelective(SysMenuRole record) {
        return sysMenuRoleMapper.insertSelective(record);
    }

    @Override
    public int deleteByRoleId(Integer roleId) {
        return sysMenuRoleMapper.deleteByRoleId(roleId);
    }

    @Override
    public int deleteByRoleIdAndMenuId(Integer roleId, Integer menuId) {
        return sysMenuRoleMapper.deleteByRoleIdAndMenuId(roleId,menuId);
    }

    @Override
    public List<SysMenuRole> selectByRoleIdAndMenuId(Integer roleId, Integer menuId) {
        return sysMenuRoleMapper.selectByRoleIdAndMenuId(roleId, menuId);
    }
}
